﻿using System.Collections.Generic;
using NetBay.Core.BusinessEntities;

namespace Rio.Framework.Pages.Events
{
    public delegate void BarcodeEventHandler(object sender, BarcodeEventArgs args);
    public delegate void BarcodeIndexingEventHandler(object sender, BarcodeIndexingEventArgs args);

    public class BarcodeEventArgs
    {

        /// <summary>
        /// Gets the processed files count.
        /// </summary>
        /// <value>The processed files count.</value>
        public int ProcessedFilesCount { get; set; }
        /// <summary>
        /// Gets the error files count.
        /// </summary>
        /// <value>The error files count.</value>
        public int ErrorFilesCount { get; set; }
        /// <summary>
        /// Gets the images.
        /// </summary>
        /// <value>The images.</value>
        public List<ImageRio> Images { get; private set; }
        /// <summary>
        /// Gets the error.
        /// </summary>
        /// <value>The error.</value>
        public string Error { get; private set; }
        /// <summary>
        /// Gets the error code.
        /// </summary>
        /// <value>The error code.</value>
        public int ErrorCode { get; private set; }
        /// <summary>
        /// Gets the has error.
        /// </summary>
        /// <value>The has error.</value>
        public bool HasError { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="BarcodeEventArgs" /> class.
        /// </summary>
        /// <param name="version">The version.</param>
        public BarcodeEventArgs(List<ImageRio> version)
        {
            this.Images = version;
            this.HasError = false;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="BarcodeEventArgs" /> class.
        /// </summary>
        /// <param name="Error">The error.</param>
        /// <param name="ErrorCode">The error code.</param>
        public BarcodeEventArgs(string Error, int ErrorCode)
        {
            this.Error = Error;
            this.ErrorCode = ErrorCode;
            this.HasError = true;
        }
    }

    public class BarcodeIndexingEventArgs
    {

        /// <summary>
        /// Gets or sets the data context.
        /// </summary>
        /// <value>The data context.</value>
        public Rio.Framework.Pages.Manager.BarcodeManager.FolderDataContext DataContext { get; set; }

        public Dictionary<long, string> NewCriteria;

        /// <summary>
        /// Gets or sets the cancel.
        /// </summary>
        /// <value>The cancel.</value>
        public bool Cancel { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="BarcodeEventArgs" /> class.
        /// </summary>
        /// <param name="version">The version.</param>
        public BarcodeIndexingEventArgs()
        {
        }

    }
}